<html>
<head><meta charset="utf-8"><title>reifying function ptrs for intrinsics #84297 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html">reifying function ptrs for intrinsics #84297</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240480809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240480809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240480809">(May 27 2021 at 14:59)</a>:</h4>
<p>hello world</p>



<a name="240481207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240481207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240481207">(May 27 2021 at 15:01)</a>:</h4>
<p>So the reason lang items and intrinsics have historically been different was in directionality – code provides lang items to the compiler and compiler provides intrinsics to code.</p>



<a name="240481250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240481250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240481250">(May 27 2021 at 15:01)</a>:</h4>
<p>not sure if we _must_ have these as separate entities though.</p>



<a name="240481354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240481354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240481354">(May 27 2021 at 15:02)</a>:</h4>
<p>It seems like a distinction that provides very little value.</p>



<a name="240481449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240481449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240481449">(May 27 2021 at 15:02)</a>:</h4>
<p>I think the most major shareholder in preserving intrinsics would be simd crates.</p>



<a name="240501765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240501765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240501765">(May 27 2021 at 17:22)</a>:</h4>
<p>The list of intrinsics is much larger than the list of lang items. In addition you can't easily check if something is a lang item, which is necessary for codegen of calls to intrinscs. You can only easily check which <code>DefId</code> corresponds to a given lang item, not if the <code>DefId</code> is a lang item. Reifying function pointers for intrinsics will require shims.</p>



<a name="240538226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240538226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240538226">(May 27 2021 at 22:04)</a>:</h4>
<p>Why are you talking about lang items? They seem mostly unrelated to intrinsics -- as you say, provider and consumer are exactly reversed.</p>



<a name="240576881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240576881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240576881">(May 28 2021 at 08:50)</a>:</h4>
<p>I was replying to <span class="user-mention" data-user-id="123586">@nagisa</span> saying that there is little value in the distinction.</p>



<a name="240578839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240578839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240578839">(May 28 2021 at 09:10)</a>:</h4>
<p>In the meeting (i would paste a link to the topic if I could figure out how to get it from the mobile app) <span class="user-mention" data-user-id="116009">@nikomatsakis</span> suggested that they would like to remove intronsics entirely.</p>



<a name="240578933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240578933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240578933">(May 28 2021 at 09:10)</a>:</h4>
<p>(my messages were hoping that the context would appear shortly thereafter)</p>



<a name="240583698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240583698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240583698">(May 28 2021 at 09:56)</a>:</h4>
<blockquote>
<p>you can't easily check if something is a lang item</p>
</blockquote>
<p>That seems fixable, I known some people in <span class="user-group-mention" data-user-group-id="3456">@T-clippy</span> wanted it for diagnostics</p>



<a name="240585837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240585837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240585837">(May 28 2021 at 10:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240481449">said</a>:</p>
<blockquote>
<p>I think the most major shareholder in preserving intrinsics would be simd crates.</p>
</blockquote>
<p>actually... they often want a Rust body that has a slow version of the intrinsic... which would be easier with lang items</p>



<a name="240585980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240585980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240585980">(May 28 2021 at 10:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240538226">said</a>:</p>
<blockquote>
<p>Why are you talking about lang items? They seem mostly unrelated to intrinsics -- as you say, provider and consumer are exactly reversed.</p>
</blockquote>
<p>lang items can be both. a function that the compiler can override with arbitrary logic</p>



<a name="240588613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240588613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240588613">(May 28 2021 at 10:51)</a>:</h4>
<p>When a lang item is a "consumer" (eg <code>extern "Rust" { #[lang="panic_impl"] fn panic_impl(pi: &amp;PanicInfo&lt;'_&gt;) -&gt; !; }</code>) it is still provided by rust code elsewhere and not by the compiler. All such lang items are weak lang items which can be provided anywhere in the crate graph for as long as it is provided at all. The matching between provider and consumer of a lang item happens by using a fixed name in the symbol mangling. The codegen backend doesn't know anything about it, unlike intrinsics.</p>



<a name="240591782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240591782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240591782">(May 28 2021 at 11:33)</a>:</h4>
<p>In my memory we did have intrinsic-ish lang items in the past. They would look a lot like:</p>
<div class="codehilite"><pre><span></span><code>#[lang = &quot;foo&quot;]
fn foo(...) -&gt; ... {
    foo(...)
}
</code></pre></div>



<a name="240592679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240592679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240592679">(May 28 2021 at 11:44)</a>:</h4>
<p>That is drop_in_place, which is even more special than most intrinsics as it gets is's own MIR depending in the type param. Arguably it should be an actual intrinsic.</p>



<a name="240608062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608062">(May 28 2021 at 14:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240578839">said</a>:</p>
<blockquote>
<p>In the meeting (i would paste a link to the topic if I could figure out how to get it from the mobile app) <span class="user-mention silent" data-user-id="116009">nikomatsakis</span> suggested that they would like to remove intronsics entirely.</p>
</blockquote>
<p>Link to start of (short) conversation: <a href="#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202021-05-27.20.2354818/near/240479357">https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202021-05-27.20.2354818/near/240479357</a></p>



<a name="240608084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608084">(May 28 2021 at 14:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240538226">said</a>:</p>
<blockquote>
<p>Why are you talking about lang items? They seem mostly unrelated to intrinsics -- as you say, provider and consumer are exactly reversed.</p>
</blockquote>
<p>I consider them totally equivalent</p>



<a name="240608094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608094">(May 28 2021 at 14:02)</a>:</h4>
<p>lang items are just "things known to the compiler for some purpose"</p>



<a name="240608102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608102">(May 28 2021 at 14:02)</a>:</h4>
<p>we use them for all kinds of reasons</p>



<a name="240608111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608111">(May 28 2021 at 14:02)</a>:</h4>
<p>one of them is to imbue them with special semantics</p>



<a name="240608124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608124">(May 28 2021 at 14:02)</a>:</h4>
<p>e.g., the <code>Sized</code> trait</p>



<a name="240608182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608182">(May 28 2021 at 14:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240585837">said</a>:</p>
<blockquote>
<p>actually... they often want a Rust body that has a slow version of the intrinsic... which would be easier with lang items</p>
</blockquote>
<p>this is exactly it</p>



<a name="240608224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608224">(May 28 2021 at 14:03)</a>:</h4>
<p>I think if we remodeled intrinsics as lang items, we could have their function bodies either be equivalent things, or ust have them directly invoke themselves.</p>



<a name="240608255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608255">(May 28 2021 at 14:04)</a>:</h4>
<p>that way, if you reference it indirectly, you get the actual function</p>



<a name="240608313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240608313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240608313">(May 28 2021 at 14:04)</a>:</h4>
<p>but when you invoke the lang item directly, you get the specially optimized version</p>



<a name="240620456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240620456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240620456">(May 28 2021 at 15:30)</a>:</h4>
<p>That seems like a footgun for enabling reification. Like, if some function was a simd operation and the implementation was a slow scalar version then a function pointer would be kind of a footgun in that instance?</p>



<a name="240620663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240620663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240620663">(May 28 2021 at 15:31)</a>:</h4>
<p>Though I guess what stdsimd or similar could do is probably:</p>
<div class="codehilite"><pre><span></span><code>#[cfg(target_feature=&quot;foo&quot;)]
#[lang=&quot;someop&quot;]
fn someop(...) {
     // slow scalar impl
}

#[cfg(not(target_feature=&quot;foo&quot;))]
#[lang=&quot;someop&quot;]
fn someop(...) {
    someop()
}
</code></pre></div>
<p>?</p>



<a name="240636723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240636723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240636723">(May 28 2021 at 17:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240620456">said</a>:</p>
<blockquote>
<p>That seems like a footgun for enabling reification. Like, if some function was a simd operation and the implementation was a slow scalar version then a function pointer would be kind of a footgun in that instance?</p>
</blockquote>
<p>Yeah, I think there'd be value in having the compile warn, if not error, if you get a function pointer to something that makes no sense as a function (such as <code>likely</code> and <code>unlikely</code>).</p>



<a name="240695574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240695574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240695574">(May 29 2021 at 10:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240583698">said</a>:</p>
<blockquote>
<blockquote>
<p>you can't easily check if something is a lang item</p>
</blockquote>
<p>That seems fixable, I known some people in <span class="user-group-mention silent" data-user-group-id="3456">T-clippy</span> wanted it for diagnostics</p>
</blockquote>
<p>FWIW we have "diagnostic items" for that usecase</p>



<a name="240695594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240695594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240695594">(May 29 2021 at 10:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240608182">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240585837">said</a>:</p>
<blockquote>
<p>actually... they often want a Rust body that has a slow version of the intrinsic... which would be easier with lang items</p>
</blockquote>
<p>this is exactly it</p>
</blockquote>
<p>this makes no sense to me, at least not for "true" intrinsics, i.e. those that actually expand the expressiveness of the language. there is no way to implement those in a "slow Rust body".<br>
we could of course do some awful hack to coerce the lang item mechanism into this shape, but IMO it would be exactly that -- an awful hack 8at least the proposals I have seen so far, which seem to be along the lines of <code>drop_in_place</code>).</p>



<a name="240695647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240695647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240695647">(May 29 2021 at 10:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240636723">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/240620456">said</a>:</p>
<blockquote>
<p>That seems like a footgun for enabling reification. Like, if some function was a simd operation and the implementation was a slow scalar version then a function pointer would be kind of a footgun in that instance?</p>
</blockquote>
<p>Yeah, I think there'd be value in having the compile warn, if not error, if you get a function pointer to something that makes no sense as a function (such as <code>likely</code> and <code>unlikely</code>).</p>
</blockquote>
<p>good point, we probably need a list of intrinsics that we allow fn ptrs for<br>
(trying to get back on topic here, the entire lang item thing is off-topic for the problem at hand^^)</p>



<a name="240710769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240710769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240710769">(May 29 2021 at 16:53)</a>:</h4>
<p>does this potential unification of lang items and intrinsics also apply to "compiler built-ins" like <a href="https://doc.rust-lang.org/src/core/macros/mod.rs.html#739-742">format_args</a>?</p>



<a name="240710830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240710830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240710830">(May 29 2021 at 16:55)</a>:</h4>
<p>probably not, macros work fine like they are now</p>



<a name="240710963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240710963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240710963">(May 29 2021 at 16:58)</a>:</h4>
<p>sure, I'm just annoyed at what feels like an arbitrary subcategory of lang items :P</p>



<a name="240711130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240711130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240711130">(May 29 2021 at 17:02)</a>:</h4>
<p>hmm, I guess we could replace <code>#[rustc_builtin_macro = "core_panic"]</code> with <code>#[lang_item = "core_panic_macro"]</code> if that's what you mean?</p>



<a name="240711136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240711136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240711136">(May 29 2021 at 17:03)</a>:</h4>
<p>might make things slightly simpler</p>



<a name="240712649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240712649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240712649">(May 29 2021 at 17:41)</a>:</h4>
<p>simpler for who? I don't think it would be much simpler for the compiler, it would have to start validating that the item is actually a macro</p>



<a name="240712939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/240712939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#240712939">(May 29 2021 at 17:49)</a>:</h4>
<p>apparently we already have <code>Target::MacroDef</code> for lang items, so we already do that</p>



<a name="241320520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320520">(Jun 02 2021 at 21:12)</a>:</h4>
<p>Should I make a separate topic to discuss what we are going to do about this <em>for the 1.53-beta</em> that becomes stable in ~two weeks?</p>



<a name="241320583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320583">(Jun 02 2021 at 21:13)</a>:</h4>
<p>in fact that was what <span class="user-mention" data-user-id="116122">@simulacrum</span> suggested on <a href="https://github.com/rust-lang/rust/issues/84297#issuecomment-845327107">github 13 days ago</a></p>



<a name="241320598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320598">(Jun 02 2021 at 21:13)</a>:</h4>
<p>It's definitely the case that likely just reverting (as we did for 1.52) would be appropriate</p>



<a name="241320602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320602">(Jun 02 2021 at 21:13)</a>:</h4>
<p>oh, whoops, I left out a message there that was in my head but never written</p>



<a name="241320629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320629">(Jun 02 2021 at 21:13)</a>:</h4>
<p>yeah, I think reverting on mainline+beta is the way to go right now</p>



<a name="241320789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320789">(Jun 02 2021 at 21:15)</a>:</h4>
<p>(note that there's some const fn unstable functions fallout, largely discoverable by chasing compiler errors)</p>



<a name="241320811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241320811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241320811">(Jun 02 2021 at 21:15)</a>:</h4>
<p>could likely be avoided with some work but it's not something I pursued</p>



<a name="241321940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241321940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241321940">(Jun 02 2021 at 21:25)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="310399">@Mara</span> , is the commit you added to PR <a href="https://github.com/rust-lang/rust/issues/81238">#81238</a> something that has to be reverted too?</p>



<a name="241321953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241321953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241321953">(Jun 02 2021 at 21:25)</a>:</h4>
<p>or is that change to the clippy lint something that should stay even when Ralf’s change is reverted?</p>



<a name="241322021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322021">(Jun 02 2021 at 21:26)</a>:</h4>
<p>checking..</p>



<a name="241322115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322115">(Jun 02 2021 at 21:27)</a>:</h4>
<p>that should be reverted too, if the rest of that PR is reverted</p>



<a name="241322238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322238">(Jun 02 2021 at 21:28)</a>:</h4>
<p>okay thanks! (I don’t know much about clippy and so I didn’t know how to interpret the addition of that empty string in the path)</p>



<a name="241322334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322334">(Jun 02 2021 at 21:29)</a>:</h4>
<p>i believe the <code>extern "rust-intrinsic" {</code> block is seen as a 'module' with an empty name, in those paths.</p>



<a name="241322555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322555">(Jun 02 2021 at 21:31)</a>:</h4>
<p>I see, that … well, I won’t say it makes sense, but its something I can understand.</p>



<a name="241322569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241322569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241322569">(Jun 02 2021 at 21:31)</a>:</h4>
<p>haha</p>



<a name="241555866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241555866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241555866">(Jun 04 2021 at 15:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/241320789">said</a>:</p>
<blockquote>
<p>(note that there's some const fn unstable functions fallout, largely discoverable by chasing compiler errors)</p>
</blockquote>
<p>Ah, I misunderstood what you were getting at here. <code>ptr::write</code> is now a <code>const fn</code>. But our stabilty attribute system should be keeping that from being observable outside of the stdlib, right?</p>



<a name="241559580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241559580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241559580">(Jun 04 2021 at 16:22)</a>:</h4>
<p>Yes, but it can't even be unstable const if you revert the PR that changed to direct intrinsics, iirc. I forget why...</p>



<a name="241582005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582005">(Jun 04 2021 at 19:26)</a>:</h4>
<p>One more thing: Don’t we need to revert PR <a href="https://github.com/rust-lang/rust/issues/84404">#84404</a> on the beta (and probably mainline) too?</p>



<a name="241582073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582073">(Jun 04 2021 at 19:26)</a>:</h4>
<p>I guess we’ll find out after I finish this revert and add a proper regression test. :)</p>



<a name="241582193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582193">(Jun 04 2021 at 19:27)</a>:</h4>
<p>(it’s entirely possible that the code path added in PR <a href="https://github.com/rust-lang/rust/issues/84404">#84404</a> is just unreachable now. Or at least, once I added the revert, the <strong>test</strong> added in <a href="https://github.com/rust-lang/rust/issues/84404">#84404</a> needs to be reverted too.)</p>



<a name="241582287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582287">(Jun 04 2021 at 19:28)</a>:</h4>
<p>hm, I would expect no, but not sure.</p>



<a name="241582293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582293">(Jun 04 2021 at 19:28)</a>:</h4>
<p>test should probably be modified</p>



<a name="241582306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582306">(Jun 04 2021 at 19:28)</a>:</h4>
<p>i.e., to use some other intrinsic pair, like likely/unlikely perhaps</p>



<a name="241582317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582317">(Jun 04 2021 at 19:28)</a>:</h4>
<p>Ah that’s a good idea</p>



<a name="241582351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582351">(Jun 04 2021 at 19:29)</a>:</h4>
<p>and I think we should land on master and beta branches a ~equivalent patch, to avoid doing this in future cycles</p>



<a name="241582461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582461">(Jun 04 2021 at 19:30)</a>:</h4>
<p>yep yep</p>



<a name="241582480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582480">(Jun 04 2021 at 19:30)</a>:</h4>
<p>I’ll make it part of the PR, which will be targetting mainline first</p>



<a name="241582574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241582574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241582574">(Jun 04 2021 at 19:31)</a>:</h4>
<p>great</p>



<a name="241585683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241585683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241585683">(Jun 04 2021 at 19:57)</a>:</h4>
<p>Test case for <a href="https://github.com/rust-lang/rust/issues/84404">#84404</a> uses intrinsics directly so it will be unaffected.</p>



<a name="241588349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241588349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241588349">(Jun 04 2021 at 20:21)</a>:</h4>
<p>Ah, but despite being in the intrinsics module those haven't been intrinsics. I forgot how confusingly it is organized</p>



<a name="241588929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241588929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241588929">(Jun 04 2021 at 20:27)</a>:</h4>
<p>yeah its unfortunate. :)</p>



<a name="241976496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976496">(Jun 08 2021 at 19:52)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="116122">@simulacrum</span> , should I see if someone else can review PR <a href="https://github.com/rust-lang/rust/issues/86003">#86003</a> ?</p>



<a name="241976587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976587">(Jun 08 2021 at 19:53)</a>:</h4>
<p>no, I can take a quick look -- it's mostly reverts I think</p>



<a name="241976602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976602">(Jun 08 2021 at 19:53)</a>:</h4>
<p>yep that’s right</p>



<a name="241976784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976784">(Jun 08 2021 at 19:54)</a>:</h4>
<p>alright, r+'d with p=1</p>



<a name="241976838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976838">(Jun 08 2021 at 19:55)</a>:</h4>
<p>thanks so much!</p>



<a name="241976853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241976853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241976853">(Jun 08 2021 at 19:55)</a>:</h4>
<p>it'd be good to verify it backports cleanly and if not fix it up, while it's on your mind</p>



<a name="241977015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/241977015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#241977015">(Jun 08 2021 at 19:56)</a>:</h4>
<p>but it'll probably be not too hard, so can be done in next round of backports. I know you're busy this week.</p>



<a name="242084186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/242084186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#242084186">(Jun 09 2021 at 15:30)</a>:</h4>
<p>I’ll look into it!</p>



<a name="244196818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244196818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244196818">(Jun 28 2021 at 19:59)</a>:</h4>
<p>so the short-term workaround impacted Rust-GPU (I guess we accidentally relied on the intrinsics being used directly?), which meant I finally had an excuse to go implement reification</p>



<a name="244196957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244196957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244196957">(Jun 28 2021 at 20:00)</a>:</h4>
<p>I've opened <a href="https://github.com/rust-lang/rust/issues/86699">#86699</a> for the reification change alone, but I also have the revert ready to flip <code>ptr::{copy,copy_nonoverlapping}</code> back into intrinsics</p>



<a name="244197248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244197248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244197248">(Jun 28 2021 at 20:02)</a>:</h4>
<p>(it could genuinely be a +1-1 change, if not for the type-level "ABI" thing and tests)</p>



<a name="244199207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244199207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244199207">(Jun 28 2021 at 20:19)</a>:</h4>
<p>interesting, I never realized there were intrinsics that were exported directly, as opposed to being wrapped in fns</p>



<a name="244199327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244199327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244199327">(Jun 28 2021 at 20:20)</a>:</h4>
<p><code>transmute</code> has to be, because its size check can't be expressed with a <code>where</code> bound (<em>yet</em>)</p>



<a name="244199376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244199376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244199376">(Jun 28 2021 at 20:21)</a>:</h4>
<p>funnily enough there's some non-intrinsic functions in <code>core::intrinsics</code>, that only exist because their names were at some point or another stable, and so we had to keep them</p>



<a name="244199602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244199602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244199602">(Jun 28 2021 at 20:23)</a>:</h4>
<p>with the reification working (and especially not exposing the pseudo-ABI in the <code>fn</code> pointer type), we should be able to make them back into actual intrinsics, backwards-compatibly</p>



<a name="244200165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244200165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244200165">(Jun 28 2021 at 20:27)</a>:</h4>
<p>(to be fair, two of the current set are <code>copy</code> and <code>copy_nonoverlapping</code>, which is where this all started in the first place)</p>



<a name="244521041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244521041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244521041">(Jul 01 2021 at 05:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span> would it make sense to discuss <a href="https://github.com/rust-lang/rust/issues/86699">#86699</a> at the meeting today? I'm curious what it would take to get it merged (or declined, at least in its current form)</p>



<a name="244526976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244526976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244526976">(Jul 01 2021 at 07:12)</a>:</h4>
<p>I'll tag it <code>I-nominated</code> but I'm not sure that's what I should do</p>



<a name="244534407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244534407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244534407">(Jul 01 2021 at 08:37)</a>:</h4>
<p>added <code>T-compiler</code> so the nomination ends up in the correct bin :)</p>



<a name="244553072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/244553072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#244553072">(Jul 01 2021 at 11:44)</a>:</h4>
<p>thanks, I always forget that part!</p>



<a name="245319852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245319852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245319852">(Jul 08 2021 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> can you clarify for me the statement "the implementation of lowered intrinsics was removed from both codegen and interpreter” — do we currently have a intrinsics lowering pass? Or was it something we tried, and then removed, and hope to put back in again?</p>



<a name="245320062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245320062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245320062">(Jul 08 2021 at 14:22)</a>:</h4>
<p>haven't had time yet to look at that, but my understanding was that a MIR pass was added, and the intrinsics the pass handles are not implemented at all in codegen or miri, anymore</p>



<a name="245320322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245320322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245320322">(Jul 08 2021 at 14:24)</a>:</h4>
<p>I wonder if it would make sense to look into generating a mir shim, them running that same pass on the shim?</p>



<a name="245320333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245320333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245320333">(Jul 08 2021 at 14:24)</a>:</h4>
<p>to avoid having multiple implementations of the same intrinsic.</p>



<a name="245321209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245321209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245321209">(Jul 08 2021 at 14:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245320062">said</a>:</p>
<blockquote>
<p>haven't had time yet to look at that, but my understanding was that a MIR pass was added, and the intrinsics the pass handles are not implemented at all in codegen or miri, anymore</p>
</blockquote>
<p>correct</p>



<a name="245347519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245347519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245347519">(Jul 08 2021 at 17:51)</a>:</h4>
<p><code>copy_nonoverlapping</code> is one of those intrinsics that no longer has implementation in codegen. Running the pass for shims should work just fine.</p>



<a name="245415706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245415706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245415706">(Jul 09 2021 at 08:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245320322">said</a>:</p>
<blockquote>
<p>I wonder if it would make sense to look into generating a mir shim, them running that same pass on the shim?</p>
</blockquote>
<p>yupp, that's p much the same thing I want to do, as per the first sentence of <a href="https://github.com/rust-lang/rust/pull/86699#issuecomment-870745885">https://github.com/rust-lang/rust/pull/86699#issuecomment-870745885</a></p>



<a name="245424059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424059">(Jul 09 2021 at 10:02)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> Is there a good reason to have the  'intrinsic' ABI, as opposed to (say) lang-items? I guess that it allows us to have duplicate declarations, but I don't know that this is a good thing. I remember that it is perhaps relevant to SIMD.</p>



<a name="245424097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424097">(Jul 09 2021 at 10:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> what we should've done years ago is just slap an attribute on them (or on the <code>extern</code> block) and use <code>extern "Rust"</code></p>



<a name="245424101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424101">(Jul 09 2021 at 10:03)</a>:</h4>
<p>Also, do we (I hope) prevent <code>extern "rust-intrinsic" fn()</code> from being a type?</p>



<a name="245424123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424123">(Jul 09 2021 at 10:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245424097">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> what we should've done years ago is just slap an attribute on them (or on the <code>extern</code> block) and use <code>extern "Rust"</code></p>
</blockquote>
<p>That seems roughly equivalent, yes--- is there a reason we can't do that now?</p>



<a name="245424133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424133">(Jul 09 2021 at 10:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245424101">said</a>:</p>
<blockquote>
<p>Also, do we (I hope) prevent <code>extern "rust-intrinsic" fn()</code> from being a type?</p>
</blockquote>
<p>It is unstable.</p>



<a name="245424180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424180">(Jul 09 2021 at 10:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245424101">said</a>:</p>
<blockquote>
<p>Also, do we (I hope) prevent <code>extern "rust-intrinsic" fn()</code> from being a type?</p>
</blockquote>
<p>it's unstable and now useless, but nothing else stops it</p>



<a name="245424201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424201">(Jul 09 2021 at 10:04)</a>:</h4>
<p>I guess that the type of <code>transmute</code> <em>before</em> coercion is a just a zero-size function type?</p>



<a name="245424214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424214">(Jul 09 2021 at 10:04)</a>:</h4>
<p>yeah, and the ABI is not part of the type anyway</p>



<a name="245424230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424230">(Jul 09 2021 at 10:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I think what keeps happening is either lang items, or a different better proposal keeps popping up on our radar, and we ignore the "obvious" solution of fixing the ABI <em>now</em></p>



<a name="245424248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424248">(Jul 09 2021 at 10:05)</a>:</h4>
<p>using <code>#[rustc_intrinsic]</code> and <code>#[rustc_platform_intrinsic]</code> or w/e</p>



<a name="245424349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424349">(Jul 09 2021 at 10:06)</a>:</h4>
<p><del>speaking of I have a WIP branch for nuking <code>extern "rust-call"</code> by adding a very limited VG impl for internal use only, that I should get back to, but that's offtopic</del></p>



<a name="245424373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424373">(Jul 09 2021 at 10:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245424230">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> I think what keeps happening is either lang items, or a different better proposal keeps popping up on our radar, and we ignore the "obvious" solution of fixing the ABI <em>now</em></p>
</blockquote>
<p>(but also we never RFC or w/e it)</p>



<a name="245424402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424402">(Jul 09 2021 at 10:07)</a>:</h4>
<p>I <em>feel</em> like lang-items are the obvious thing, but <code>#[rustc_intrinsic]</code> seems also ok</p>



<a name="245424431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424431">(Jul 09 2021 at 10:07)</a>:</h4>
<p>presumably more like <code>#[rustc_intrinsic(name)]</code>, I guess?</p>



<a name="245424441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424441">(Jul 09 2021 at 10:07)</a>:</h4>
<p>or maybe we just take the name from the function itself</p>



<a name="245424490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424490">(Jul 09 2021 at 10:08)</a>:</h4>
<p>ultimately the point (from a lang POV) is that "there are special functions in libcore that are well known to the compiler"</p>



<a name="245424515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424515">(Jul 09 2021 at 10:08)</a>:</h4>
<p>Lang items can currently only be looked up. You can't check if an item is a lang item.</p>



<a name="245424524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424524">(Jul 09 2021 at 10:08)</a>:</h4>
<p>sure you can</p>



<a name="245424541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424541">(Jul 09 2021 at 10:08)</a>:</h4>
<p>but it's awkward :)</p>



<a name="245424571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424571">(Jul 09 2021 at 10:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245424490">said</a>:</p>
<blockquote>
<p>ultimately the point (from a lang POV) is that "there are special functions in libcore that are well known to the compiler"</p>
</blockquote>
<p>this is more what I am getting at, I don't have a strong opinion about the impl mechanism</p>



<a name="245424579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424579">(Jul 09 2021 at 10:08)</a>:</h4>
<p>tbh I feel like every time lang items are brought up near intrinsics, fixing this gets pushed farther into the future :P</p>



<a name="245424597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424597">(Jul 09 2021 at 10:09)</a>:</h4>
<p>I don't really know what the difference is between lang items and intrinsics, but if making a separate category of attribute helps, I'm in favor :)</p>



<a name="245424866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424866">(Jul 09 2021 at 10:12)</a>:</h4>
<p>I guess the difference is:</p>
<ul>
<li>intrinsic: a function which, when directly called, has its body inlined with special semantics that are otherwise impossible</li>
<li>lang item: other "well known" items that are referenced by the compiler rules, but their semantics are identical or close to the original thing (e.g., Clone has special impls)</li>
</ul>
<p>I think most lang items behave like any other item of their kind, they just get used by the rules in various ways. This is probably the distinction. I'm not sure if it's a hard rule, but it's generally true.</p>



<a name="245424877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245424877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245424877">(Jul 09 2021 at 10:12)</a>:</h4>
<p>That seems fine to me.</p>



<a name="245425059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425059">(Jul 09 2021 at 10:15)</a>:</h4>
<p>yeah, sounds good</p>



<a name="245425096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425096">(Jul 09 2021 at 10:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> when you said "lang proposal" on the PR, what's the procedure you were thinking of? I may have heard something about lang team MCPs, are those a thing nowadays?</p>



<a name="245425158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425158">(Jul 09 2021 at 10:16)</a>:</h4>
<p>Yes</p>



<a name="245425173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425173">(Jul 09 2021 at 10:16)</a>:</h4>
<p>I just spent a bunch of time writing new docs, but they're still in a PR</p>



<a name="245425184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425184">(Jul 09 2021 at 10:16)</a>:</h4>
<p>that said, the docs include an "alternative route" of nominating a PR</p>



<a name="245425188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425188">(Jul 09 2021 at 10:16)</a>:</h4>
<p>so you're ok :)</p>



<a name="245425208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425208">(Jul 09 2021 at 10:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297/near/245425173">said</a>:</p>
<blockquote>
<p>I just spent a bunch of time writing new docs, but they're still in a PR</p>
</blockquote>
<p><a href="https://github.com/rust-lang/lang-team/pull/105">https://github.com/rust-lang/lang-team/pull/105</a></p>



<a name="245425219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425219">(Jul 09 2021 at 10:17)</a>:</h4>
<p>when are the lang meetings? if you don't mind me showing up</p>



<a name="245425225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425225">(Jul 09 2021 at 10:17)</a>:</h4>
<p>Don't mind at all!</p>



<a name="245425230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425230">(Jul 09 2021 at 10:17)</a>:</h4>
<p>(and if my schedule doesn't conflict)</p>



<a name="245425234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425234">(Jul 09 2021 at 10:17)</a>:</h4>
<p><a href="https://lang-team.rust-lang.org/calendar.html">https://lang-team.rust-lang.org/calendar.html</a></p>



<a name="245425260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425260">(Jul 09 2021 at 10:17)</a>:</h4>
<p>hah neat docs</p>



<a name="245425454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/245425454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#245425454">(Jul 09 2021 at 10:20)</a>:</h4>
<p><del>there's grammar wg meetings? (sorry, this is getting offtopic)</del> nvm, outdated</p>



<a name="246630342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/246630342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#246630342">(Jul 20 2021 at 18:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I didn't get around to making a proposal yet (got busy with some other stuff) - does <a href="https://github.com/rust-lang/rust/pull/86699#issuecomment-883584970">https://github.com/rust-lang/rust/pull/86699#issuecomment-883584970</a> mean I don't have to open an "initiative" issue for it?</p>



<a name="246644821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/246644821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#246644821">(Jul 20 2021 at 20:26)</a>:</h4>
<p>You don't need to open an initiative.</p>



<a name="246644883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/246644883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#246644883">(Jul 20 2021 at 20:26)</a>:</h4>
<p>Assuming that lang FCP goes through, consider this pre-approval for any subsequent PR implementing this behavior without having to re-check with the lang team.</p>



<a name="246644911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reifying%20function%20ptrs%20for%20intrinsics%20%2384297/near/246644911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reifying.20function.20ptrs.20for.20intrinsics.20.2384297.html#246644911">(Jul 20 2021 at 20:27)</a>:</h4>
<p>(Assuming it follows the general outline of "make intrinsics work as if they were functions".)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>